<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>栏目列表</title>
	<script type='text/javascript' src='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/hdjs/hdui/css/hdui.css' rel='stylesheet' media='screen'>
<script src='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/hdjs/hdui/js/hdui.js'></script>
<link href='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/css/hdvalidate.css' rel='stylesheet' media='screen'>
<script src='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/js/hdvalidate.js'></script>
<script src='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/cal/lhgcalendar.min.js'></script>
<script src='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/hdjs/hdslide/js/hdslide.js'></script>
<script type='text/javascript'>
HOST = 'http://localhost';
ROOT = 'http://localhost/gks/1113/shop';
WEB = 'http://localhost/gks/1113/shop/index.php';
URL = 'http://localhost/gks/1113/shop/index.php/Admin/Category/index&cid=0';
APP = 'http://localhost/gks/1113/shop/HSHOP';
COMMON = 'http://localhost/gks/1113/shop/HSHOP/Common';
HDPHP = 'http://localhost/gks/1113/hdphp/hdphp';
HDPHPDATA = 'http://localhost/gks/1113/hdphp/hdphp/Data';
HDPHPEXTEND = 'http://localhost/gks/1113/hdphp/hdphp/Extend';
MODULE = 'http://localhost/gks/1113/shop/index.php/Admin';
CONTROLLER = 'http://localhost/gks/1113/shop/index.php/Admin/Category';
ACTION = 'http://localhost/gks/1113/shop/index.php/Admin/Category/index';
STATIC = 'http://localhost/gks/1113/shop/Static';
HDPHPTPL = 'http://localhost/gks/1113/hdphp/hdphp/Lib/Tpl';
VIEW = 'http://localhost/gks/1113/shop/HSHOP/Admin/View';
PUBLIC = 'http://localhost/gks/1113/shop/HSHOP/Admin/View/Public';
CONTROLLERVIEW = 'http://localhost/gks/1113/shop/HSHOP/Admin/View/Category';
HISTORY = 'http://localhost/gks/1113/shop/index.php/Admin/Category/index&cid=2';
</script>
</head>
<body>
	<div class='wrap hd-form'>
		<div class='menu_list'>
			<ul>
				<li>
					<a href="<?php echo U('add');?>">添加栏目</a>
				</li>
				<li>
					<a href="<?php echo U('update');?>">更新缓存</a>
				</li>
				<li style="margin-bottom:10px;">
					<select>
						<option value="0">==选择顶级栏目==</option>
						<?php $hd["list"]["c"]["total"]=0;if(isset($cat) && !empty($cat)):$_id_c=0;$_index_c=0;$lastc=min(1000,count($cat));
$hd["list"]["c"]["first"]=true;
$hd["list"]["c"]["last"]=false;
$_total_c=ceil($lastc/1);$hd["list"]["c"]["total"]=$_total_c;
$_data_c = array_slice($cat,0,$lastc);
if(count($_data_c)==0):echo "";
else:
foreach($_data_c as $key=>$c):
if(($_id_c)%1==0):$_id_c++;else:$_id_c++;continue;endif;
$hd["list"]["c"]["index"]=++$_index_c;
if($_index_c>=$_total_c):$hd["list"]["c"]["last"]=true;endif;?>

							<?php if($c['pid'] == 0){?>
							<option value="<?php echo $c['cid'];?>" <?php if($c['cid'] == $_GET['cid']){?>selected=""<?php }?>><?php echo $c['_name'];?></option>
							<?php }?>
						<?php $hd["list"]["c"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
					</select>
				</li>
			</ul>
		</div>
		<div>
			<table class='table2'>
				<thead>
					<tr>
						<td class='w50'>CID</td>
						<td>名称</td>
						<td>显示</td>
						<td class='w200'>操作</td>
					</tr>
				</thead>
				<tbody>
					<?php $hd["list"]["c"]["total"]=0;if(isset($category) && !empty($category)):$_id_c=0;$_index_c=0;$lastc=min(1000,count($category));
$hd["list"]["c"]["first"]=true;
$hd["list"]["c"]["last"]=false;
$_total_c=ceil($lastc/1);$hd["list"]["c"]["total"]=$_total_c;
$_data_c = array_slice($category,0,$lastc);
if(count($_data_c)==0):echo "";
else:
foreach($_data_c as $key=>$c):
if(($_id_c)%1==0):$_id_c++;else:$_id_c++;continue;endif;
$hd["list"]["c"]["index"]=++$_index_c;
if($_index_c>=$_total_c):$hd["list"]["c"]["last"]=true;endif;?>

						<tr>
							<td><?php echo $c['cid'];?></td>
							<td><?php echo $c['_name'];?></td>
							<td><?php echo $c['is_show_text'];?></td>
							<td>
								<a href="<?php echo U('edit',array('cid'=>$c['cid']));?>">编辑</a> |
								<a href="<?php echo U('add',array('cid'=>$c['cid']));?>">添加子栏目</a> |
								<a href="<?php echo U('del',array('cid'=>$c['cid']));?>" onclick="return confirm('确定删除该栏目及其子栏目吗？')">删除</a>
							</td>
						</tr>
					<?php $hd["list"]["c"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
				</tbody>
			</table>
		</div>
	</div>
	<link type="text/css" rel="stylesheet" href="http://localhost/gks/1113/shop/HSHOP/Admin/View/Category/css/index.css"/>
	<script type="text/javascript" src="http://localhost/gks/1113/shop/HSHOP/Admin/View/Category/js/index.js"></script>
</body>
</html>